package com.eastcom.providor.dao.impl;

import java.util.Date;
import java.util.List;

import com.eastcom.bm.atom.CollectMonitor;
import com.eastcom.providor.dao.BaseDao;
import com.eastcom.providor.dao.ICollectMonitor;

public class CollectMonitorDao extends BaseDao implements ICollectMonitor {

	public List<CollectMonitor> queryByConditions(String hostIp, String taskId,Date date) throws Exception {
		String hql="from CollectMonitor where hostIp=? and taskid=? and dataStart<=? and dataEnd>? order by collectStart desc";
		List<CollectMonitor> ret=null;
		try {
			 ret = this.getObjects(hql, new Object[] {
					hostIp, taskId, date, date },0,10);
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return ret;
	}

}
